<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\AttributeType
 *
 * @property int $typeid 类别ID
 * @property string $typename 名称
 * @property int $displayorder 显示顺序
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AttributeOption[] $options
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AttributeType whereDisplayorder($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AttributeType whereTypeid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AttributeType whereTypename($value)
 * @mixin \Eloquent
 */
class AttributeType extends Model
{
    protected $table = 'attribute_type';
    protected $primaryKey = 'typeid';
    protected $guarded = ['typeid'];

    public $timestamps = false;

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function options()
    {
        return $this->hasMany(AttributeOption::class, 'typeid', 'typeid');
    }
}
